import { reqOrderPayInfo,reqPayStatus} from "@/api";
const actions = {
  async getOrderPayInfo({commit},orderId){
    let res = await reqOrderPayInfo(orderId);
    if(res.code==200){
      commit('ORDER_PAY_INFO',res.data);
    }
  },
  async getPayStatus({commit},orderId){
    let res = await reqPayStatus(orderId);
    return res.code;
  }
  
};
const mutations = {
  ORDER_PAY_INFO(state,payInfo){
    state.payInfo = payInfo;
  }
};
const state = {
  payInfo:{},
};
const getters = {
  payInfo(state){
    return state.payInfo || {};
  }
};
export default {
  namespaced:true,
  actions,
  mutations,
  state,
  getters,
}